package com.wzcl.app.dao.model;

import com.wzcl.app.dao.model.common.Base;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.util.Date;

//快递订单
@Data
@Entity
@Table(name = "Delivery",
        indexes = {
                @Index(columnList = "userPhone"),
                @Index(columnList = "orderNo")
        }
)
@ApiModel(value = "快递订单")
@EntityListeners(AuditingEntityListener.class)
public class Delivery implements Base {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    @ApiModelProperty(value = "所属用户手机")
    private String userPhone;

    @ApiModelProperty(value = "订单Id")
    private String orderId;

    @ApiModelProperty(value = "订单编号")
    private String orderNo;

    @ApiModelProperty(value = "收件人姓名")
    private String name;

    @ApiModelProperty(value = "收件人手机")
    private String phone;

    @ApiModelProperty(value = "详细地址")
    private String path;

    @ApiModelProperty(value = "详细地址")
    private String pathInfo;

    @ApiModelProperty(value = "快递单号")
    private String deliveryNo;

    @ApiModelProperty(value = "快递公司")
    private String deliveryCompany;

    @CreatedDate
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "发货时间")
    private Date sendTime;

    @LastModifiedDate
    @ApiModelProperty(value = "修改时间")
    private Date updateTime;

    @ApiModelProperty(value = "快递状态")
    private Integer deliveryState;

    @ApiModelProperty(value = "货物描述")
    private String description;

    @ApiModelProperty(value = "状态")
    private Integer state;
}
